package cn.guet.tourism.base;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 基础Controller
 *
 * @param <S>
 * @param <T>
 * @author SAGITTAR
 */
public class BaseController<S extends IBaseService<T>, T extends AbstractModel<T>> {

	protected final Logger logger = LogManager.getLogger(getClass());

	@Autowired
	protected S service;

	/**
	 * 重定向新地址
	 *
	 * @param newUrl
	 * @return
	 */
	protected String redirectTo(String newUrl) {
		return "redirect:".concat(newUrl);
	}
}
